<%@LANGUAGE="VBSCRIPT" %>
<HTML XMLNS="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE>Excel Report</TITLE>
<LINK HREF="UniversalStyleSheet.css" REL="stylesheet" TYPE="text/css" />
<!--calendar scripts -->
<SCRIPT LANGUAGE="JavaScript" SRC="JavaSupportFiles/CalendarPopup.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">document.write(getCalendarStyles());</SCRIPT>
<SCRIPT LANGUAGE="JavaScript" ID="jscal1x">
var cal1xx = new CalendarPopup("CalendarDiv");
cal1xx.showYearNavigation();
cal1xx.showYearNavigationInput();
cal1xx.setWeekStartDay(1);
</SCRIPT>

<% 
fromdate=request.QueryString("fromdate")
todate=request.QueryString("todate")
fromtime=request.QueryString("fromtime")
totime=request.QueryString("totime")
action=request.QueryString("action")
if fromdate="" then fromdate=date()
if fromtime="" then fromtime="12:00:00 AM"
if todate="" then todate=date()
if totime="" then totime="11:59:59 PM"
fromfull=fromdate & " " & fromtime
tofull=todate & " " & totime
%>


<SCRIPT TYPE="text/javascript">
function OpenEmail(){
	url="EmailForm.asp"
	title="EmailWindow"
	params="width=600, height=430,status=no"
	popup=window.open (url,title,params)
}

function SaveReport_click(){
tc=document.getElementById("TicketCount")
'if (tc.value="") or (tc.value="0") then'
'	msgbox ("There is no report data to save")'
'	exit function'
'end if'

fromdate=document.getElementById("FromDate").value
fromtime=document.getElementById("FromTime").value
todate=document.getElementById("ToDate").value
totime=document.getElementById("ToTime").value
if (fromdate ==""){ fromdate="<%= date() %>"}
if (fromtime ==""){ fromtime="12:00:00 AM"}
if (todate ==""){ todate="<%= date() %>"}
if (totime ==""){ totime="11:59:00 PM"}
fromfull=fromdate + " " + fromtime
tofull = todate + " " + totime

url="SaveReport.asp?fromfull=" + fromfull + "&tofull=" + tofull + "&ticketcount=" + tc.value
title="SaveReport"
params="width=370,height=325,status=no"
popup=window.open(url,title,params)
}
</SCRIPT>
</HEAD>

<BODY>
<TABLE WIDTH="900" BORDER="0" CELLSPACING="0" CELLPADDING="0">
  <TR>
    <TD WIDTH="20" HEIGHT="20" BACKGROUND="Images/TableUpperLeft.png">&nbsp;</TD>
    <TD WIDTH="860" HEIGHT="20" BACKGROUND="Images/TableUpperMiddle.png">&nbsp;</TD>
    <TD WIDTH="20" HEIGHT="20" BACKGROUND="Images/TableUpperRight.png">&nbsp;</TD>
  </TR>
  <TR>
    <TD WIDTH="20" BACKGROUND="Images/TableMiddleLeft.png">&nbsp;</TD>
    <TD BGCOLOR="#FFFFFF">
	<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="1" BGCOLOR="#009900">
      <TR>
        <TD WIDTH="79%" HEIGHT="22" VALIGN="middle" BGCOLOR="#FFFFFF" CLASS="ResultsAddress"><FORM ACTION="ExcelReportData.asp?action=retrieve" METHOD="post" NAME="RetrieveForm" TARGET="ExcelData" ID="RetrieveForm">
          From<SPAN CLASS="SearchFormText"><A HREF="#" onClick="cal1xx.select(document.forms['RetrieveForm'].FromDate,'fromlink','MM/dd/yyyy'); return false;" TITLE="Click To Open Calendar To Choose The 'From' Date" NAME="fromlink" ID="fromlink"><IMG SRC="Images/calendar.jpg" ALT="Click To Choose From Date" WIDTH="17" HEIGHT="18" BORDER="0" ALIGN="absbottom"></A></SPAN>
		  <INPUT NAME="FromDate" TYPE="text" ID="FromDate" SIZE="10" VALUE="<%= date() %>">
		  <INPUT NAME="FromTime" TYPE="text" ID="FromTime" SIZE="12" VALUE="12:00:00 AM">
- To<SPAN CLASS="SearchFormText"><A HREF="#" onClick="cal1xx.select(document.forms['RetrieveForm'].ToDate,'tolink','MM/dd/yyyy'); return false;" TITLE="Click To Open Calendar To Choose The 'To' Date" NAME="tolink" ID="tolink"><IMG SRC="Images/calendar.jpg" ALT="Click To Choose 'To' Date" WIDTH="17" HEIGHT="18" BORDER="0" ALIGN="absbottom"></A></SPAN>
<INPUT NAME="ToDate" TYPE="text" ID="ToDate" SIZE="10" VALUE="<%= date() %>">
<INPUT NAME="ToTime" TYPE="text" ID="ToTime" SIZE="12" VALUE="11:59:59 PM">
<IMG SRC="Images/ViewButton.png" ALT="Click To Retrieve Tickets" WIDTH="50" HEIGHT="25" ALIGN="absbottom" onClick="document.RetrieveForm.submit()">
        <IMG SRC="Images/SaveButton_small.png" ALT="Click To Save This Report To As An Excel SpreadSheet" WIDTH="50" HEIGHT="25" ALIGN="absbottom" onClick="SaveReport_click()">
        <IMG SRC="Images/EmailButton.png" ALT="Click To Email A Report As An Attachment" WIDTH="50" HEIGHT="25" ALIGN="absbottom" onClick="OpenEmail()">
        <INPUT NAME="TicketCount" TYPE="hidden" ID="TicketCount" SIZE="2" >
        </FORM>          </TD>
        <TD WIDTH="21%" BGCOLOR="#FFFFFF" CLASS="ResultsAddress">&nbsp;</TD>
      </TR>
      <TR>
        <TD COLSPAN="2" BGCOLOR="#D2FFD2" CLASS="ResultsAddress">&nbsp;</TD>
        </TR>
      <TR>
        <TD COLSPAN="2" BGCOLOR="#FFFFFF" CLASS="ResultsAddress">
		<IFRAME ID="ExcelData" NAME="ExcelData"src="ExcelReportData.asp" WIDTH="850" HEIGHT="600" FRAMEBORDER="0"></IFRAME>		</TD>
        </TR>
    </TABLE></TD>
    <TD WIDTH="20" BACKGROUND="Images/TableMiddleRight.png">&nbsp;</TD>
  </TR>
  <TR>
    <TD WIDTH="20" HEIGHT="20" BACKGROUND="Images/TableLowerLeft.png">&nbsp;</TD>
    <TD WIDTH="860" HEIGHT="20" BACKGROUND="Images/TableLowerMiddle.png">&nbsp;</TD>
    <TD WIDTH="20" HEIGHT="20" BACKGROUND="Images/TableLowerRight.png">&nbsp;</TD>
  </TR>
</TABLE>
<DIV ID="CalendarDiv" STYLE="position:absolute;visibility:hidden;background-color:white;layer-background-color:white;"></DIV>
</BODY>
</HTML>
